package com.zhuxiaomei.mapper;

import com.zhuxiaomei.entity.invitationCode.InvitationCode;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

/**
 * @author hxm
 * @date 2024/12/9 19:24
 * @description
 */
public interface InvitationCodeMapper extends Mapper<InvitationCode> {

    @Select("select id, invitation_code, remaining_count from invitation_codes where invitation_code = #{invitationCode} and remaining_count > 0")
    InvitationCode isValid(@Param("invitationCode") String invitationCode);
}
